var app = angular.module('BookmarkApp', []);
app.config(function($routeProvider, $locationProvider) {
    $routeProvider
        .when('/add', {
            templateUrl: 'tpls/add.html',
            controller: 'BookmarkController'
        }) 
        .when('/edit/:id', {
            templateUrl: 'tpls/edit.html',
            controller: 'BookmarkController'
        })
        .when('/', {
            templateUrl: 'tpls/list.html',
            controller: 'BookmarkController'
        });
});

app.controller('BookmarkController', function($scope, $routeParams, $location) {
    $scope.add = function() {
        alert("add");
    };
    
    $scope.delete = function(id) {
        if (!confirm('Confirm delete')) {
            return;
        }
        alert("delete");
    };
    
    $scope.save = function() {
        alert("save");
    };
    
});